package com.learn.cloud.validator.bean;

import lombok.Getter;

/**
 * @description: 校验结果
 * @author: cong zhi
 * @createDate: 2022/2/6 0:29
 * @updateUser: cong zhi
 * @updateDate: 2022/2/6 0:29
 * @updateRemark: 修改内容
 * @version: v1.0
 */
@Getter
public class ValidationResult {

    private boolean ok;

    private String message;

    public static ValidationResult ok() {
        ValidationResult validationResult = new ValidationResult();
        validationResult.ok = true;
        return validationResult;
    }

    public static ValidationResult error(String message) {
        ValidationResult validationResult = new ValidationResult();
        validationResult.ok = false;
        validationResult.message = message;
        return validationResult;
    }
}
